/*
 * Java Card File Parser 
 * Based on openjcvm project 
 */
package org.naive.metawatch.converter.parser;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;
import java.text.ParseException;

/**
 *
 * @author Andrew Butenko
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface ParsedInt {

    FieldSize value();

    public class FieldParser {

        public static Object parse(ParsedInt p, ParseContext x, Field f) throws ParseException {
            return x.read(p.value());
        }
    }
}
